from django.shortcuts import HttpResponse
from django.urls import reverse


def url_demo_1(request):
    print(f"url_demo_1 url resolver_match is {request.resolver_match}")
    return HttpResponse(f"url_demo_1 url resolver_match is {request.resolver_match}  url is {reverse('apps.api:url_1')}")


def year_archive_str(request, year):
    print("year_archive_str ", year)
    return HttpResponse(f"year_archive_str  {year}")


def year_archive_slug(request, year):
    print("year_archive_slug ", year)
    return HttpResponse(f"year_archive_slug {year}")


def year_archive(request, year):
    print("year_archive ", year)
    return HttpResponse(f"year_archive {year}")


def month_archive(request, year, month):
    print("month_archive ", year, month)
    return HttpResponse(f"month_archive {year} {month}")


def article_detail(request, year, month, slug):
    print("article_detail", year, month, slug)
    return HttpResponse(f"article_detail {year} {month} {slug}")


def page(request, num=1):
    print("page Parameter default", num)
    return HttpResponse(f"page  Parameter default  {num}")
